/*
 * Hyuga: A Density-Grid Stream Clustering Platform.
 * Copyright (C) 2014 PUC-Rio/Laboratory for Advanced Collaboration
 *
 * Hyuga is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Hyuga is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Hyuga.  If not, see <http://www.gnu.org/licenses/>.
 */
package br.pucrio.inf.lac.konoha.hyuga.events.cell;

import br.pucrio.inf.lac.konoha.hyuga.events.LocationUpdateEvent;

/**
 * Represent a location update event that changed (moved away) from one cell to another one. The event is composed by 
 * the previous event and the current location update. Using this information the Hyuga engine will recalculate the
 * previous location update cell density, since with the Location Update movement the cell can become transitional or
 * non-dense.
 *
 * @author Marcos Roriz <mroriz@inf.puc-rio.br>
 */
public class CellChangedEvent {
    private LocationUpdateEvent previous;
    private LocationUpdateEvent current;
    
    // Empty Constructor
    public CellChangedEvent() {}

    // Basic Constructor
    public CellChangedEvent(LocationUpdateEvent previous, LocationUpdateEvent current) {
        this.previous = previous;
        this.current  = current;
    }
    
    @Override
    public String toString() {
        return "MOVED FROM (" + previous.getX() + ", " + previous.getY() + ") TO (" + current.getX() + ", " + current.getY() + ")";
    }

    //////////////////////////////////////////////////////////////////////////
    // Gets and Sets
    //////////////////////////////////////////////////////////////////////////
    
    public LocationUpdateEvent getPrevious() {
        return previous;
    }

    public void setPrevious(LocationUpdateEvent previous) {
        this.previous = previous;
    }

    public LocationUpdateEvent getCurrent() {
        return current;
    }

    public void setCurrent(LocationUpdateEvent current) {
        this.current = current;
    }

    
}
